<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>图片</title>
</head>
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<!-- 引入样式 -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<!-- 引入组件库 -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<body>
<div id="app">
    <el-upload
            action="/fileUpload"
            method="post"
            :on-preview="handlePreview"
            :limit="10"
    >
        <el-button type="primary">
            点击上传
        </el-button>
    </el-upload>
    <img src="">
</div>

<script>
    new Vue({
        el:'#app',
        methods:{
            handlePreview(file){
                console.log(file)
                window.open(file.response.data)
            }
        }
    })
</script>

</body>
</html>